#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2021/3/27 0:42
# @Author  : Grayson Liu
# @Email   : graysonliu@foxmail.com
# @File    : WelcomeForm.py

from PyQt5.Qt import *

from ui.Ui_WelcomeForm import Ui_WelcomeForm


class WelcomeForm(QWidget, Ui_WelcomeForm):
    def __init__(self, parent=None):
        super(WelcomeForm, self).__init__(parent)
        self.setupUi(self)
        self.show_whatsnew()
        self.show_help()

    def show_whatsnew(self):
        with open("text/whatsnew.txt", "r", encoding="utf-8") as f:
            self.textWhatsNew.append(f.read())

    def show_help(self):
        with open("text/help.txt", "r", encoding="utf-8") as f:
            self.textHelp.append(f.read())
